package com.zhongyouyun;


import com.alibaba.fastjson.serializer.SerializerFeature;
import com.alibaba.fastjson.support.config.FastJsonConfig;
import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter;
import com.alicp.jetcache.anno.config.EnableCreateCacheAnnotation;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.zhongyouyun.utils.SpringUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;


@SpringBootApplication
@EnableCreateCacheAnnotation
@EnableTransactionManagement
public class ZhongyouyunApplication extends SpringBootServletInitializer {

    private final static Logger logger = LoggerFactory.getLogger(ZhongyouyunApplication.class);

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        // 注意这里要指向原先用main方法执行的Application启动类
        return builder.sources(ZhongyouyunApplication.class);
    }
    public static void main(String[] args) {
        SpringApplication.run(ZhongyouyunApplication.class, args);
        System.out.println(IdWorker.getId());
        logger.info("GunsApplication is success!");
    }
}
